//
//  CheckUtil.m
//  GJNK
//
//  Created by xmdfst on 16/10/17.
//  Copyright © 2016年 LYX. All rights reserved.
//

#import "CheckUtil.h"

@implementation CheckUtil

+(BOOL)isValidPhoneNum:(NSString*)phone
{
    //    NSString *mobileRegex = @"1[0-9]{10}";
    NSString *mobileRegex = @"^1\\d{10}$";
    NSPredicate *mobileTest = [NSPredicate predicateWithFormat:@"SELF MATCHES %@", mobileRegex];
    return [mobileTest evaluateWithObject:phone];
    
}

/*车牌号验证 MODIFIED BY HELENSONG*/
+(BOOL)isValidateCarNo:(NSString*)carNo
{
    NSString *carRegex = @"^[A-Za-z]{1}[A-Za-z_0-9]{5}$";
    NSPredicate *carTest = [NSPredicate predicateWithFormat:@"SELF MATCHES %@",carRegex];
    NSLog(@"carTest is %@",carTest);
    return [carTest evaluateWithObject:carNo];
}

@end
